<?php
namespace app\portal\model;
use think\Db;
use think\Model;
class TeacherModel extends Model{
    public function getAll(){
        return Db::name('teacher')->select();
    }

    public  function   character(){
        return $this->hasOne('teacher_character','teache_id','id');//"teacher"代表教师表
    }
    public  function   experience(){
        return $this->hasOne('teacher_experience','teache_id','id');//"teacher"代表教师表
    }
    public  function   gradute(){
        return $this->hasOne('teacher_gradute_school','teache_id','id');//"teacher"代表教师表
    }
    public  function   tcase(){
        return $this->hasMany('teacher_case','teache_id','id');//"teacher"代表教师表
    }
    public  function   course(){
        return $this->hasMany('teacher_course_manager','teache_id','id');//"teacher"代表教师表
    }
    public  function  picture(){
        return $this->hasMany('teacher_picture','teache_id','id');//"teacher"代表教师表
    }

}
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/16 0016
 * Time: 下午 5:26
 */